package Logic;

import io.netty.channel.Channel;

public class Client {
    //这里用String是因为netty的原因
    private String id;
    //netty出来的channel，可直接用户网络传输
    private Channel channel;
    //每个客户端（airplane）分配到id，在一个match中，是unique的，用来让每个客户端知道who is who
    private int playerId;
    //用户系统中的unique id，跟上面的id一样的地方是uid和id都是唯一的，但是uid比较短。
    private String uid;

    private int currentScore;
    private float totalRunTime;
    private float pushScoreTime;
    private float heartBeatTime;

    public Client(String id, String uid, Channel channel) {
        this.id = id;
        this.uid = uid;
        this.channel = channel;
        currentScore = 0;
        totalRunTime = 0;
        pushScoreTime = 0;
    }

    public String GetId() {
        return id;
    }

    public void SetPlayerId(int id) {
        playerId = id;
    }

    public int GetPlayerId() {
        return playerId;
    }

    public Channel GetChannel() {
        return channel;
    }

    public String GetUId() {
        return uid;
    }

    public float GetHeartBeatTime() {
        return heartBeatTime;
    }

    public void SetHeartBeatTime(float time) {
        heartBeatTime = time;
    }
}
